package com.hnhegui.backend.payment.service;

import com.hnhegui.backend.payment.dto.request.PaymentRequestDTO;
import com.hnhegui.backend.payment.dto.response.PaymentResponseDTO;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.UUID;

/**
 * @author 刘大海
 * @since 2025/10/27 09:09
 */
@Service
public class PaymentService {

    /**
     * 发起支付
     */
    public PaymentResponseDTO initiatePayment(PaymentRequestDTO request) {
        // 生成支付信息（模拟）
        PaymentResponseDTO response = new PaymentResponseDTO();
        response.setPaymentId(UUID.randomUUID().toString());
        response.setPaymentUrl("https://pay.example.com/pay/" + response.getPaymentId());
        response.setQrCode("https://qr.example.com/qr/" + response.getPaymentId());
        response.setExpireTime(LocalDateTime.now().plusMinutes(30));

        return response;
    }

}
